{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "# author: Yabin Zheng\n",
    "# Email: sczhengyabin@hotmail.com\n",
    "\n",
    "import re\n",
    "from bs4 import BeautifulSoup\n",
    "from concurrent import futures\n",
    "import sys\n",
    "import time\n",
    "import pandas as pd\n",
    "import requests\n",
    "import json\n",
    "from fake_useragent import UserAgent"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "HEADERS = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 多线程数量设置\n",
    "NUM_THREADS = 5\n",
    "\n",
    "city_dict = {\"成都\": \"cd\", \"北京\": \"bj\", \"上海\": \"sh\", \"广州\": \"gz\", \"深圳\": \"sz\", \"南京\": \"nj\", \"合肥\": \"hf\", \"杭州\": \"hz\", }\n",
    "CITY = city_dict[\"广州\"]\n",
    "\n",
    "# 是否打印 HTTP error\n",
    "PRINT = False\n",
    "proxies = None\n",
    "ua = UserAgent()\n",
    "\n",
    "BAIDU_AK = \"gTiZ7d7Ivp4lM0nVFIieIUjRkoxr4PS3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 代理设置"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "PROXY_HOST = \"proxy.abuyun.com\"\n",
    "PROXY_PORT = \"9020\"\n",
    "PROXY_USERNAME = 'H99H75AT4V8D761D'\n",
    "PROXY_PASSWORD = '9EEDC185780C0189'\n",
    "\n",
    "def gen_proxies_from_cert(proxy_user, proxy_password):\n",
    "    proxy_meta = \"http://%(user)s:%(pass)s@%(host)s:%(port)s\" % {\n",
    "        \"host\" : PROXY_HOST,\n",
    "        \"port\" : PROXY_PORT,\n",
    "        \"user\" : proxy_user,\n",
    "        \"pass\" : proxy_password\n",
    "    }\n",
    "\n",
    "    proxies = {\n",
    "        \"http\"  : proxy_meta,\n",
    "        \"https\" : proxy_meta\n",
    "    }\n",
    "\n",
    "    return proxies\n",
    "\n",
    "abuyun_proxies = gen_proxies_from_cert(PROXY_USERNAME, PROXY_PASSWORD)\n",
    "proxies = abuyun_proxies"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 函数定义"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" Get 操作封装 \"\"\"\n",
    "def get_bs_obj_from_url(http_url):\n",
    "    done = False\n",
    "    exception_time = 0\n",
    "    HEADERS[\"User-Agent\"] = ua.random\n",
    "    while not done:\n",
    "        try:\n",
    "            if PRINT:\n",
    "                print(\"正在获取 {}\".format(http_url))\n",
    "            r = requests.get(http_url, headers=HEADERS, proxies=proxies)\n",
    "            bs_obj = BeautifulSoup(r.text, \"html.parser\")\n",
    "            done = True\n",
    "        except Exception as e:\n",
    "            if PRINT:\n",
    "                print(e)\n",
    "            exception_time += 1\n",
    "            time.sleep(1)\n",
    "            if exception_time > 10:\n",
    "                return None\n",
    "    return bs_obj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 获取城市的行政区域列表 \"\"\"\n",
    "def get_district_from_city(city):\n",
    "    print(\"********** 获取城市的行政区域: {} **********\".format(city))\n",
    "    city_url = \"http://{}.lianjia.com\".format(city)\n",
    "    http_url = city_url + \"/xiaoqu\"\n",
    "    bs_obj = get_bs_obj_from_url(http_url)\n",
    "    \n",
    "    parent_div = bs_obj.find(\"div\", {\"data-role\": \"ershoufang\"})\n",
    "    a_list = parent_div.find_all(\"a\")\n",
    "    \n",
    "    district_list = [a.attrs[\"href\"].replace(\"/xiaoqu/\", \"\")[:-1] \n",
    "                         for a in a_list\n",
    "                         if a.attrs['href'].startswith(\"/xiaoqu\")]\n",
    "    \n",
    "    print(\"########## 总共 {} 个行政区域 ##########\".format(len(district_list)))\n",
    "    \n",
    "    return district_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 获取一个行政区域的所有小区ID列表 \"\"\"\n",
    "def get_xiaoqu_from_district(city, district):\n",
    "    xiaoqu_list = []\n",
    "    http_url = \"http://{}.lianjia.com/xiaoqu/{}\".format(city, district)\n",
    "    exception_time = 0\n",
    "    done = False\n",
    "    while not done:\n",
    "        try:\n",
    "            bs_obj = get_bs_obj_from_url(http_url)\n",
    "            total_pages = int(json.loads(bs_obj.find(\"div\", {\"class\": \"page-box house-lst-page-box\"}).attrs[\"page-data\"])[\"totalPage\"])\n",
    "            total_xiaoqu_num = int(bs_obj.find(\"h2\", {\"class\": \"total fl\"}).find(\"span\").get_text())\n",
    "            done = True\n",
    "        except Exception as e:\n",
    "            exception_time += 1\n",
    "            if exception_time > 10:\n",
    "                return xiaoqu_list\n",
    "\n",
    "    with futures.ThreadPoolExecutor(max_workers=NUM_THREADS) as executor:\n",
    "        future_list = []\n",
    "        for page_no in range(1, total_pages + 1):\n",
    "            future_list.append(executor.submit(get_xiaoqu_in_page, city, district, page_no))\n",
    "        fail_list = []\n",
    "        count = 0\n",
    "        for future in futures.as_completed(future_list):\n",
    "            page_no, xiaoqu_list_partial = future.result()\n",
    "            if xiaoqu_list_partial is None or len(xiaoqu_list_partial) == 0:\n",
    "                fail_list.append(page_no)\n",
    "            else:\n",
    "                xiaoqu_list += xiaoqu_list_partial\n",
    "                count += 1\n",
    "                sys.stdout.write(\"\\r当前行政区域 {} 已完成: {}/{}\".format(\n",
    "                    district, count, total_pages))\n",
    "        for page_no in fail_list:\n",
    "            page_no, xiaoqu_list_partial = get_xiaoqu_in_page(city, district, page_no)\n",
    "            if xiaoqu_list_partial is not None and len(xiaoqu_list_partial) > 0:\n",
    "                xiaoqu_list += xiaoqu_list_partial\n",
    "            count += 1\n",
    "            sys.stdout.write(\"\\r当前行政区域 {} 已完成: {}/{}\".format(\n",
    "                district, count, total_pages))\n",
    "    print(\"\")\n",
    "    return xiaoqu_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 获取一个行政区域某一页的小区列表 \"\"\"\n",
    "def get_xiaoqu_in_page(city, district, page_no):\n",
    "    http_url = \"http://{}.lianjia.com/xiaoqu/{}/pg{}\".format(city, district, page_no)\n",
    "    bs_obj = get_bs_obj_from_url(http_url)\n",
    "    \n",
    "    if bs_obj is None:\n",
    "        return None\n",
    "    \n",
    "    parent_list = bs_obj.find_all(\"li\", {\"class\": \"clear xiaoquListItem\"})\n",
    "    \n",
    "    xiaoqu_list = []\n",
    "    \n",
    "    if not (len(parent_list) == 0):\n",
    "        for li in parent_list:\n",
    "            xiaoqu_url = li.find(\"div\", {\"class\": \"title\"}).find(\"a\").attrs[\"href\"]\n",
    "            xiaoqu_id = \"\".join(list(filter(str.isdigit, xiaoqu_url)))\n",
    "            xiaoqu_list.append(xiaoqu_id)\n",
    "    return page_no, xiaoqu_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 获取一个城市的所有小区ID列表 \"\"\"\n",
    "def get_xiaoqu_of_city(city):\n",
    "    district_list = get_district_from_city(city)\n",
    "    xiaoqu_list = []\n",
    "    for district in district_list:\n",
    "        xiaoqu_of_district = get_xiaoqu_from_district(city, district)\n",
    "        xiaoqu_list += xiaoqu_of_district\n",
    "        print(\"****** 当前行政区域 {} 的小区数: {}, 总小区数: {} ******\".format(\n",
    "            district, len(xiaoqu_of_district), len(xiaoqu_list)))\n",
    "    return xiaoqu_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 根据小区ID获取小区详细信息 \"\"\"\n",
    "def get_xiaoqu_info(city, xiaoqu_id):\n",
    "    http_url = \"http://{}.lianjia.com/xiaoqu/{}\".format(city, xiaoqu_id)\n",
    "    bs_obj = get_bs_obj_from_url(http_url)\n",
    "    \n",
    "    df = pd.DataFrame()\n",
    "    \n",
    "    if bs_obj is not None:\n",
    "        try:\n",
    "            location_list = bs_obj.find(\"div\", {\"class\": \"fl l-txt\"}).find_all(\"a\")\n",
    "            info_city = location_list[1].get_text().replace(\"小区\", \"\")\n",
    "            info_district = location_list[2].get_text().replace(\"小区\", \"\")\n",
    "            info_area = location_list[3].get_text().replace(\"小区\", \"\")\n",
    "            info_name = location_list[4].get_text()\n",
    "\n",
    "            if bs_obj.find(\"span\", {\"class\": \"xiaoquUnitPrice\"}) is not None:\n",
    "                info_price = bs_obj.find(\"span\", {\"class\": \"xiaoquUnitPrice\"}).get_text()\n",
    "            else:\n",
    "                info_price = \"暂无报价\"\n",
    "\n",
    "            info_address = bs_obj.find(\"div\", {\"class\": \"detailDesc\"}).get_text()\n",
    "\n",
    "            info_list = bs_obj.find_all(\"span\", {\"class\": \"xiaoquInfoContent\"})\n",
    "            info_year = info_list[0].get_text().replace(\"年建成\", \"\")\n",
    "            info_type = info_list[1].get_text()\n",
    "            info_property_fee = info_list[2].get_text()\n",
    "            info_property_company = info_list[3].get_text()\n",
    "            info_developer_company = info_list[4].get_text()\n",
    "            info_building_num = info_list[5].get_text().replace(\"栋\", \"\")\n",
    "            info_house_num = info_list[6].get_text().replace(\"户\", \"\")\n",
    "\n",
    "            df = pd.DataFrame(data=[[xiaoqu_id, http_url, info_name, info_city,\n",
    "                                     info_district, info_area, info_price, info_year,\n",
    "                                     info_building_num, info_house_num, info_developer_company, info_property_fee,\n",
    "                                     info_property_company, info_type, info_address]],\n",
    "                              columns=[\"ID\", \"URL\", \"小区名称\", \"城市\",\n",
    "                                       \"区域\", \"片区\", \"参考均价\", \"建筑年代\",\n",
    "                                       \"总栋数\", \"总户数\", \"开发商\",\"物业费\",\n",
    "                                       \"物业公司\", \"建筑类型\", \"地址\"])\n",
    "        except Exception as e:\n",
    "            print(e)\n",
    "\n",
    "    return xiaoqu_id, df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 根据城市和小区ID列表，获取所有小区的详细信息 \"\"\"\n",
    "def get_xiaoqu_info_from_xiaoqu_list(city, xiaoqu_list):\n",
    "    df_xiaoqu_info = pd.DataFrame()\n",
    "    count = 0\n",
    "    pct = 0\n",
    "    \n",
    "    with futures.ThreadPoolExecutor(max_workers=NUM_THREADS) as executor:\n",
    "        future_list = []\n",
    "        for xiaoqu in xiaoqu_list:\n",
    "            future_list.append(executor.submit(get_xiaoqu_info, city, xiaoqu))\n",
    "        fail_list = []\n",
    "        print(\" \")\n",
    "        for future in futures.as_completed(future_list):\n",
    "            xiaoqu, df_info_partial = future.result()\n",
    "            if len(df_info_partial) == 0:\n",
    "                fail_list.append(xiaoqu)\n",
    "            else:\n",
    "                df_xiaoqu_info = df_xiaoqu_info.append(df_info_partial)\n",
    "                count += 1\n",
    "                sys.stdout.write(\"\\r获取小区信息: {}/{}\".format(count, len(xiaoqu_list)))\n",
    "        for page_no in fail_list:\n",
    "            xiaoqu, df_info_partial = get_xiaoqu_info(city, xiaoqu)\n",
    "            if len(df_info_partial) > 0:\n",
    "                df_xiaoqu_info = df_xiaoqu_info.append(df_info_partial)\n",
    "                count += 1\n",
    "        sys.stdout.write(\"\\r获取小区信息: {}/{}\".format(count, len(xiaoqu_list)))\n",
    "\n",
    "    return df_xiaoqu_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 获取小区成交记录的某一页的内容 \"\"\"\n",
    "def get_xiaoqu_transactions_in_page(city, xiaoqu_id, page_no):\n",
    "    http_url = \"http://{}.lianjia.com/chengjiao/pg{}c{}/\".format(city, page_no, xiaoqu_id)\n",
    "    bs_obj = get_bs_obj_from_url(http_url)\n",
    "    \n",
    "    df = pd.DataFrame()\n",
    "    \n",
    "    if bs_obj is not None:\n",
    "        try:\n",
    "            div_list = bs_obj.find_all(\"div\", {\"class\": \"info\"})\n",
    "            \n",
    "            for div in div_list:\n",
    "                div_title = div.find(\"div\", {\"class\": \"title\"}).find(\"a\")\n",
    "                url = div_title.attrs[\"href\"]\n",
    "                trans_id = url[url.rfind('/')+1:url.rfind('.')]\n",
    "                title_strs = div_title.get_text().split(\" \")\n",
    "                xiaoqu_name = title_strs[0]\n",
    "                house_type = title_strs[1]\n",
    "                built_area = title_strs[2].replace(\"平米\", \"\")\n",
    "                \n",
    "                house_info_strs = div.find(\"div\", {\"class\": \"houseInfo\"}).get_text().replace(\" \", \"\").split(\"|\")\n",
    "                direction = house_info_strs[0]\n",
    "                decoration = house_info_strs[1].replace(\"&nbsp;\", \"\")\n",
    "                if len(house_info_strs) == 3:\n",
    "                    elevator = house_info_strs[2].replace(\"电梯\", \"\")\n",
    "                else:\n",
    "                    elevator = \"\"\n",
    "                \n",
    "                deal_date = div.find(\"div\", {\"class\": \"dealDate\"}).get_text()\n",
    "                deal_price = div.find(\"div\", {\"class\": \"totalPrice\"}).find(\"span\", {\"class\": \"number\"}).get_text()\n",
    "                \n",
    "                position_info_strs = div.find(\"div\", {\"class\": \"positionInfo\"}).get_text().split(\" \")\n",
    "                floor = position_info_strs[0]\n",
    "                build_year = int(position_info_strs[1].split(\"年建\")[0]) if \"年建\" in position_info_strs[1] else \"\"\n",
    "                build_type = position_info_strs[1].split(\"年建\")[1] if \"年建\" in position_info_strs[1] else position_info_strs[1]\n",
    "                \n",
    "                unit_price = div.find(\"div\", {\"class\": \"unitPrice\"}).find(\"span\", {\"class\": \"number\"}).get_text()\n",
    "                \n",
    "                span_deal_cycle = div.find(\"span\", {\"class\": \"dealCycleTxt\"}).find_all(\"span\")\n",
    "                if len(span_deal_cycle) == 2:\n",
    "                    list_price = \"\".join(list(filter(lambda x: str.isdigit(x) or (x == \".\"), span_deal_cycle[0].get_text())))\n",
    "                    deal_cycle = \"\".join(list(filter(str.isdigit, span_deal_cycle[1].get_text())))\n",
    "                else:\n",
    "                    deal_cycle = \"\".join(list(filter(str.isdigit, span_deal_cycle[0].get_text())))\n",
    "                    list_price = \"\"\n",
    "                    \n",
    "                \n",
    "                temp_df = pd.DataFrame(data=[[trans_id, xiaoqu_id, xiaoqu_name, house_type, \n",
    "                                              built_area, deal_price, list_price, unit_price, \n",
    "                                              deal_cycle, deal_date, direction, decoration, \n",
    "                                              elevator, floor, build_year, build_type]], \n",
    "                                       columns=[\"成交记录ID\", \"小区ID\", \"小区名称\", \"户型\", \n",
    "                                                \"建筑面积\", \"成交价\", \"挂牌价\", \"单价\",\n",
    "                                                \"成交周期\", \"成交日期\", \"朝向\", \"装修\",\n",
    "                                                \"电梯\", \"楼层\", \"建筑年份\", \"建筑类型\",])\n",
    "                df = df.append(temp_df)\n",
    "            \n",
    "        except Exception as e:\n",
    "            print(xiaoqu_id, page_no, e)\n",
    "    \n",
    "    return df\n",
    "\n",
    "\"\"\" 获取小区所有的成交记录 \"\"\"\n",
    "def get_xiaoqu_transactions(city, xiaoqu_id):    \n",
    "    df_xiaoqu_transctions = pd.DataFrame()\n",
    "    \n",
    "    for i in range(3):\n",
    "        try:\n",
    "            http_url = \"http://{}.lianjia.com/chengjiao/c{}/\".format(city, xiaoqu_id)\n",
    "            bs_obj = get_bs_obj_from_url(http_url)\n",
    "            total_transaction_num = int(bs_obj.find(\"div\", {\"class\": \"total fl\"}).find(\"span\").get_text())\n",
    "            if total_transaction_num == 0:\n",
    "                return df_xiaoqu_transctions\n",
    "            total_pages = int(json.loads(bs_obj.find(\"div\", {\"class\": \"page-box house-lst-page-box\"}).attrs[\"page-data\"])[\"totalPage\"])\n",
    "            \n",
    "            break\n",
    "        except Exception as e:\n",
    "            print(xiaoqu_id, e)\n",
    "            if i == 4:\n",
    "                return df_xiaoqu_transctions\n",
    "        \n",
    "    fail_list = []\n",
    "    for page_no in range(1, total_pages+1):\n",
    "        xiaoqu_transactions_partial = get_xiaoqu_transactions_in_page(city, xiaoqu_id, page_no)\n",
    "        if xiaoqu_transactions_partial is None or len(xiaoqu_transactions_partial) == 0:\n",
    "            fail_list.append(page_no)\n",
    "        else:\n",
    "            df_xiaoqu_transctions = df_xiaoqu_transctions.append(xiaoqu_transactions_partial) \n",
    "    for page_no in fail_list:\n",
    "        xiaoqu_transactions_partial = get_xiaoqu_transactions_in_page(city, xiaoqu_id, page_no)\n",
    "        if xiaoqu_transactions_partial is not None and len(xiaoqu_transactions_partial) > 0:\n",
    "            df_xiaoqu_transctions = df_xiaoqu_transctions.append(xiaoqu_transactions_partial)        \n",
    "    return df_xiaoqu_transctions    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\" 根据小区ID列表，获取所有小区的所有成交记录 \"\"\"\n",
    "def get_transactions_from_xiaoqu_list(city, xiaoqu_list):\n",
    "    df = pd.DataFrame()\n",
    "    print(\" \")\n",
    "    \n",
    "    with futures.ThreadPoolExecutor(max_workers=NUM_THREADS) as executor:\n",
    "        future_list = []\n",
    "        for xiaoqu in xiaoqu_list:\n",
    "            future_list.append(executor.submit(get_xiaoqu_transactions, city, xiaoqu))\n",
    "        fail_list = []\n",
    "        count = 0\n",
    "        for future in futures.as_completed(future_list):\n",
    "            if future.exception() is not None:\n",
    "                print(future.exception())\n",
    "            else:\n",
    "                xiaoqu_transactions_partial = future.result()\n",
    "                df = df.append(xiaoqu_transactions_partial)    \n",
    "            count += 1\n",
    "            sys.stdout.write(\"\\rProgress: {}/{}\".format(count, len(xiaoqu_list)))\n",
    "    return df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 爬取城市的小区ID列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "********** 获取城市的行政区域: bj **********\n",
      "########## 总共 17 个行政区域 ##########\n",
      "当前行政区域 dongcheng 已完成: 38/38\n",
      "****** 当前行政区域 dongcheng 的小区数: 1131, 总小区数: 1131 ******\n",
      "当前行政区域 xicheng 已完成: 54/54\n",
      "****** 当前行政区域 xicheng 的小区数: 1594, 总小区数: 2725 ******\n",
      "当前行政区域 chaoyang 已完成: 58/58\n",
      "****** 当前行政区域 chaoyang 的小区数: 1727, 总小区数: 4452 ******\n",
      "当前行政区域 haidian 已完成: 56/56\n",
      "****** 当前行政区域 haidian 的小区数: 1656, 总小区数: 6108 ******\n",
      "当前行政区域 fengtai 已完成: 39/39\n",
      "****** 当前行政区域 fengtai 的小区数: 1153, 总小区数: 7261 ******\n",
      "当前行政区域 shijingshan 已完成: 8/8\n",
      "****** 当前行政区域 shijingshan 的小区数: 218, 总小区数: 7479 ******\n",
      "当前行政区域 tongzhou 已完成: 21/21\n",
      "****** 当前行政区域 tongzhou 的小区数: 610, 总小区数: 8089 ******\n",
      "当前行政区域 changping 已完成: 24/24\n",
      "****** 当前行政区域 changping 的小区数: 715, 总小区数: 8804 ******\n",
      "当前行政区域 daxing 已完成: 15/15\n",
      "****** 当前行政区域 daxing 的小区数: 427, 总小区数: 9231 ******\n",
      "当前行政区域 yizhuangkaifaqu 已完成: 4/4\n",
      "****** 当前行政区域 yizhuangkaifaqu 的小区数: 95, 总小区数: 9326 ******\n",
      "当前行政区域 shunyi 已完成: 11/11\n",
      "****** 当前行政区域 shunyi 的小区数: 306, 总小区数: 9632 ******\n",
      "当前行政区域 fangshan 已完成: 18/18\n",
      "****** 当前行政区域 fangshan 的小区数: 528, 总小区数: 10160 ******\n",
      "当前行政区域 mentougou 已完成: 7/7\n",
      "****** 当前行政区域 mentougou 的小区数: 201, 总小区数: 10361 ******\n",
      "当前行政区域 pinggu 已完成: 1/1\n",
      "****** 当前行政区域 pinggu 的小区数: 25, 总小区数: 10386 ******\n",
      "当前行政区域 huairou 已完成: 2/2\n",
      "****** 当前行政区域 huairou 的小区数: 37, 总小区数: 10423 ******\n",
      "当前行政区域 miyun 已完成: 3/3\n",
      "****** 当前行政区域 miyun 的小区数: 69, 总小区数: 10492 ******\n",
      "当前行政区域 yanqing 已完成: 1/1\n",
      "****** 当前行政区域 yanqing 的小区数: 30, 总小区数: 10522 ******\n"
     ]
    }
   ],
   "source": [
    "xiaoqu_list = get_xiaoqu_of_city(CITY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "list write finished.\n"
     ]
    }
   ],
   "source": [
    "with open(\"{}_list.txt\".format(CITY), mode=\"w\") as f:\n",
    "    for xiaoqu in xiaoqu_list:\n",
    "        f.write(xiaoqu + \"\\n\")\n",
    "print(\"list write finished.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 从文件读取小区ID列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "with open(\"{}_list.txt\".format(CITY), mode=\"r\") as f:\n",
    "    xiaoqu_list = [line[:-1] for line in f.readlines()]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 爬取小区ID列表对应的小区信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      "获取小区信息: 119/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 194/10522'NoneType' object has no attribute 'find_all'\n",
      "'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 512/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 584/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 1325/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 1779/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 2172/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 2316/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 2592/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 2629/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 2687/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 3158/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 3370/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 3377/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 3546/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 3961/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4019/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4072/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4711/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4767/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4790/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4902/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4924/10522'NoneType' object has no attribute 'find_all'\n",
      "'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 4991/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5000/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5236/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5306/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5477/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5614/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5705/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5929/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5965/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 5985/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6015/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6264/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6595/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6597/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6616/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6937/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 6947/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 7358/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8059/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8202/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8289/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8326/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8366/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8474/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8516/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8577/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8860/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 8881/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 9112/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 9242/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 9680/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 10067/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 10408/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 10458/10522'NoneType' object has no attribute 'find_all'\n",
      "获取小区信息: 10522/10522"
     ]
    }
   ],
   "source": [
    "df_xiaoqu_info = get_xiaoqu_info_from_xiaoqu_list(CITY, xiaoqu_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "infos write finished.\n"
     ]
    }
   ],
   "source": [
    "# 保存为UTF8 CSV\n",
    "df_xiaoqu_info.to_csv(\"{}_info.csv\".format(CITY), sep=\",\", encoding=\"utf-8\")\n",
    "\n",
    "# 保存为Excel\n",
    "writer = pd.ExcelWriter(\"{}_info.xlsx\".format(CITY))\n",
    "df_xiaoqu_info.to_excel(writer, \"小区信息\")\n",
    "writer.save()\n",
    "\n",
    "print(\"infos write finished.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 爬取二手房交易记录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      "1111027376532 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378078 11111027380693 1 'NoneType' object has no attribute 'get_text'\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027378766 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379801 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380693 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378078 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375691 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375663 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381407 11111027378766  'NoneType' object has no attribute 'get_text'\n",
      "2 'NoneType' object has no attribute 'get_text'1111027379801\n",
      " 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380693 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376532 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 1/10521 'NoneType' object has no attribute 'get_text'\n",
      "1111043313490 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375691 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375663 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375670 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 2/10521111027375691 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 3/10521111027378766 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027379801 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 4/10521111027382420 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375663 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374021 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379801 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043313490 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380878 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 5/10521111043313490 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 6/10521111043316752 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382420 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374021 2 'NoneType' object has no attribute 'get_text'1111027375180\n",
      " 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379801 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 7/10521111027377390 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373684 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379888 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043316752 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381407 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 8/10521111027378766 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027373684 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380770 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379888 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378679 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378766 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375180 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 9/10521111027382420 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380770 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 10/10521111027379888 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374021 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 11/10521111043316752 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381162 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378766 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374065 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043316752 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380693 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 12/10521111027378766 5 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 13/10521111043316752 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 14/10521111027381162 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379888 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 15/10521111027377390 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380878 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374081 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374962 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 16/10521111027381162 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 17/10521111027382420 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 18/10521111027373684 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382285 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380878 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377390 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027373684 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 20/1052'NoneType' object has no attribute 'get_text'\n",
      "1111043313755 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380878 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381776 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374081 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381367 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 21/10521111027380878 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 23/10521111027374044 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381776 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 5 'NoneType' object has no attribute 'get_text'\n",
      "11110273742671111027378022  21  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027374689 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043313755 11110273813672 2  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027374081 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374044 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375108 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374965 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 24/10521111027374267 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 25/10521111027374081 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381367 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381477 5 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 26/10521111027374219 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375108 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043316306 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374219 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374044 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 27/10521111027378022 3 'NoneType' object has no attribute 'get_text'\n",
      "1111043313755 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374689 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381776 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 28/10521111027378022 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374065 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043316306 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375204 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 29/10521111043313755 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375108 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 30/10521111027374081 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374689 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 31/10521111027374216 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377234 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381367 4 'NoneType' object has no attribute 'get_text'\n",
      "1111043313755 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 32/10521111027378022 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374065 3 'NoneType' object has no attribute 'get_text'\n",
      "1111043316306 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374074 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381367 1 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027374689 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377234 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374216 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375204 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374953 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 33/10521111027374074 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377023 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381367 3 'NoneType' object has no attribute 'get_text'\n",
      "1111043316306 1 'NoneType' object has no attribute 'get_text'1111027375656\n",
      " 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378887 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373924 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374216 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381367 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 34/10521111027374953 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 36/1052'NoneType' object has no attribute 'get_text'\n",
      "1111027378022 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 37/1052 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374074 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027373924 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378887 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374689 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375656 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377234 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 38/1052'NoneType' object has no attribute 'get_text'\n",
      "1111027374216 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377023 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375204 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027378129 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375656 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027378887 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027373924 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374080 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376862 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 39/10522 'NoneType' object has no attribute 'get_text'\n",
      "1111027378887 11111027374216  3 'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "Progress: 40/10521111027378129 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 41/10522 'NoneType' object has no attribute 'get_text'\n",
      "11110273756561111027377023  42  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "Progress: 42/10521111027378887 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 43/105211110273740721111027378129  13  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027373924 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377932 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376862 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377502 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374690 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375656 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377932 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374072 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381160 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376676 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382512 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 44/10521111027380239 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374690 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027376676 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374072 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381160 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378129 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376862 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374690 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375656 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 45/10521111027381160 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374072 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380239 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378129 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377932 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376862 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 46/10521111027382512 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376676 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 47/10521111027374072 5 1111027378129'NoneType' object has no attribute 'get_text' \n",
      "6 'NoneType' object has no attribute 'get_text'\n",
      "1111027376862 5 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 48/10521111027375208 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377502 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380239 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027378129 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382512 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 49/10521111027380239 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374745 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377932 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381655 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375208 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378129 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374072 5 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 50/10521111027377234 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380239 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374745 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 51/10521111027376862 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027377502 3 'NoneType' object has no attribute 'get_text'1111027377932\n",
      " 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378129 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380239 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374862 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381313 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 52/10521111027380769 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380239 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 53/10521111027374862 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 54/10521111027374080 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377234 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376882 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 55/10521111027377234 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 56/10521111027375737 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 57/10521111027378129 6 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 58/10521111027375208 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376862 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374690 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377932 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 59/10521111027374715 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 60/10521111027375208 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 61/10521111027381655 5 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 62/1052NoneType' object has no attribute 'get_text'\n",
      "Progress: 63/1052'NoneType' object has no attribute 'get_text'\n",
      "1111027378092 11111027376862  'NoneType' object has no attribute 'get_text'3\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 64/10521111027374080 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381096 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 65/10521111027381328 1 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Progress: 66/10521111027377502 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 67/10526 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 68/10521111027374080 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375464 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 69/10521111027374690 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 70/10521111027374671 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374755 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 71/10521111027374080 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 72/10521111027381014 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 73/10521111027374080 2 'NoneType' object has no attribute 'get_text'\n",
      "1111041129296 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 74/10521111027379719 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 75/10521111027374671 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 76/10521111027378095 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 77/10521111027381442 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 78/10521111027375477 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382254 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 79/10521111027374080 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 80/10521111027375460 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 81/10521111027380038 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 82/10521111027380023 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 83/10521111027375477 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 84/10521111042948189 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374062 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 85/10521111027377099 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378737 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 86/10521111027377631 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 87/10521111027378107 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378391 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 88/1052'NoneType' object has no attribute 'get_text'\n",
      "1111027375629 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373899 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 89/10521111027377099 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380769 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 90/10521111027376599 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377099 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 91/10521111027376456 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376504 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 92/10521111027379726 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375629 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 93/10521111027374682 1 1111027376298 'NoneType' object has no attribute 'get_text'1\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027381843 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376599 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376456 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 94/10521111027376503 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 95/1052'NoneType' object has no attribute 'get_text' \n",
      "2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 97/10521111027374682 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 98/1052'NoneType' object has no attribute 'get_text'\n",
      "1111027376599 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375657 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377074 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 99/10521111027376503 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 100/10521111046292412 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 101/10521111027373900 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376298 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381584 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 102/10521111027376599 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027378881 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373900 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 103/10521111027379726 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 104/10521111027374682 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376599 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380288 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376298 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 105/10521111027375657 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378881 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374682 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 106/10521111027376599 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 107/10521111027375828 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380288 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 108/10521111027375868 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375205 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 109/10521111027376599 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 110/10521111027375828 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 111/10521111027381250 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 113/10521111027377770 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375868 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 114/10521111027376066 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373855 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377016 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 115/10521111027376066 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 116/10521111027375115 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 117/10521111027378881 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 118/10521111027382017 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 119/10521111027377770 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376667 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377802 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 120/10521111027374989 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 121/10521111027376493 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 122/10521111027377770 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 123/10521111027375660 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375848 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 124/10521111027381582 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 125/10521111027373733 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376667 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027373925 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 126/10521111027373855 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 127/10521111027379349 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 128/10521111027375660 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 129/10521111027378001 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 130/10521111027379716 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 131/10521111027376667 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 132/10521111027373943 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 133/10521111027376991 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375729 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 135/1052 'NoneType' object has no attribute 'get_text'\n",
      "1111027373733 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 136/10521111027380096 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 138/10521111027378498 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380021 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 139/10521111027376499 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 140/10521111027375729 2 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Progress: 141/10521111027374784 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 142/10521111027377140 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 144/10521111027380094 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 146/10521111027377412 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380093 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 147/10521111027378498 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 149/10521111027377412 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 152/10521111027376753 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380028 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 155/10521111027376753 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 156/10521111027380545 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 158/10521111027381012 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 160/10521111027378459 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 161/10521111043241688 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380545 11110273807721  'NoneType' object has no attribute 'get_text'\n",
      "Progress: 162/1052 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 165/10521111043241688 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 168/10521111027375633 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 171/10521111027377835 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 176/10521111027374085 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 177/10521111027379351 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 180/10521111027377835 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379569 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 182/10521111818599198994 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 187/10521111027379697 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 188/10521111027376459 1 1111027381336'NoneType' object has no attribute 'get_text' \n",
      "1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 189/10521111027374920 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378870 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 190/10521111027379569 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 192/10521111027373698 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 193/10521111027381336 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 194/10521111027376763 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374920 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 195/10521111027374625 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382048 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382438 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 196/10521111027374625 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 197/10521111027378063 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 198/10521111027379651 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 200/10521111046835333 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 203/10521111027376763 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 204/10521111027382048 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 205/10521111027375203 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 207/10521111027374239 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377077 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376551 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374222 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378889 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043314469 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374222 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376551 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380911 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043314469 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378889 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377077 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376551 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374222 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380911 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043314469 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376551 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 208/10521111027379858 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 209/10521111027374075 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378889 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374222 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380911 11110273775483  1'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027377077 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380911 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 4 1111027376918'NoneType' object has no attribute 'get_text'\n",
      " 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374222 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374075 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375199 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378889 4 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374075 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376918 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043314469 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375199 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374222 3 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 210/10521111027377548 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 7 'NoneType' object has no attribute 'get_text'\n",
      "1111043314469 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374075 4 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377077 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027378889 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375215 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 211/1052oneType' object has no attribute 'get_text'\n",
      "1111043314469 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377548 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376918 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375199 3 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027378889 5 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 212/10521111027374239 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377077 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375215 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 213/1052 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 214/10521111027378886 1 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 215/10521111027376918 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374239 6 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 216/10521111027377077 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375215 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027376918 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375215 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 8 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111043314469 4 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 217/1052 'NoneType' object has no attribute 'get_text'\n",
      "1111027381164 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379462 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380911 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374993 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377501 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 3 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380911 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027374220 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 4 'NoneType' object has no attribute 'get_text'\n",
      "111102737520311110273794621111027377077  12  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text' \n",
      "\n",
      "2 'NoneType' object has no attribute 'get_text'\n",
      "11110433158561111027375114 5  2'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027381164 2 'NoneType' object has no attribute 'get_text'\n",
      "Progress: 218/10521111027374993 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377077 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374993 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374220 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 5 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027374220 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027379462 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381473 11110273809111 1111027375572 'NoneType' object has no attribute 'get_text'\n",
      " 14  1111043315856'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text' \n",
      "\n",
      "7 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375203 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027376918 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027379462 4 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379462 5 'NoneType' object has no attribute 'find_all'\n",
      "1111027374220 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 6 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375202 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376748 7 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375933 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375215 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 4 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375215 4 'NoneType' object has no attribute 'get_text'1111027375933\n",
      " 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380018 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375202 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027377501 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375933 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375202 3 'NoneType' object has no attribute 'get_text'\n",
      "1111043314949 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376670 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375933 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377501 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375933 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 5 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375202 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376916 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377501 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381425 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381473 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375114 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375202 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 3 'NoneType' object has no attribute 'get_text'\n",
      "11110273814251111027374050 2  1'NoneType' object has no attribute 'get_text'\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380696 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 5 'NoneType' object has no attribute 'get_text'\n",
      "1111043315856 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376916 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 1111027377501 2 'NoneType' object has no attribute 'get_text'\n",
      "3 'NoneType' object has no attribute 'get_text'1111027374686\n",
      " 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380696 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381167 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381835 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375572 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027373971 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375607 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377501 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376735 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374686 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380696 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382662 1 1111027373685 5 'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027381840 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378893 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375462 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027380019 1 'NoneType' object has no attribute 'get_text'\n",
      "1111046318849 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376665 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378272 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380112 1 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027376212 'NoneType' object has no attribute 'find'\n",
      "1111027374052 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376665 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027379915 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381634 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379720 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378852 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 4 'NoneType' object has no attribute 'get_text'\n",
      "1111046318849 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374055 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027379915 11111027377970 'NoneType' object has no attribute 'get_text' \n",
      "1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381634 2 'NoneType' object has no attribute 'get_text'\n",
      "1111046318849 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027373685 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382662 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382756 1 'NoneType' object has no attribute 'get_text'\n",
      "1111046567076 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381634 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376212 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027374673 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382662 2 'NoneType' object has no attribute 'get_text'\n",
      "1111046567076 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380030 1 'NoneType' object has no attribute 'get_text'\n",
      "1111041150489 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380673 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382643 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 3 'NoneType' object has no attribute 'get_text'\n",
      "1111041150489 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374269 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376497 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378417 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027376497 1 'NoneType' object has no attribute 'get_text'\n",
      "1111047062895 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 6 'NoneType' object has no attribute 'get_text'\n",
      "1111047062895 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375433 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027373720 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377078 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375265 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027376197 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377078 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373732 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376197 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373757 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379462 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375632 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375258 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373954 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376899 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376601 1 1111027382668'NoneType' object has no attribute 'get_text' \n",
      "1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377614 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376195 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374706 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380890 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380773 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376601 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374706 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380890 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380773 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381520 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375658 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376931 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374706 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381520 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375576 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376601 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382668 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377723 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375658 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376601 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375573 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377723 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373757 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381489 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375214 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380890 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027379254 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375258 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381489 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380890 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382668 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374757 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375258 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378416 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378578 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374757 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378094 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373856 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378094 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378578 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380009 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378257 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379788 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375259 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375574 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374056 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375196 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374294 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377923 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381312 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378578 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027373861 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375259 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374056 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377923 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376046 1 'NoneType' object has no attribute 'get_text'\n",
      "11110273792541111027373859  2'NoneType' object has no attribute 'find' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027379860 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378438 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375725 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381583 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380639 11111027379254  'NoneType' object has no attribute 'get_text'1\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027377400 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378438 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382567 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375725 1 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027375262 11110273789561  1'NoneType' object has no attribute 'get_text' 111102737385911110273774001111027373852\n",
      "'NoneType' object has no attribute 'get_text'   1\n",
      "11   'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "\n",
      "1111027378090 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379348 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376764 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373852 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027373829 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376571 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378491 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379053 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373853 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380887 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379053 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027373853 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043316665 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378491 11110273738522  2'NoneType' object has no attribute 'get_text' 1111027373909\n",
      "'NoneType' object has no attribute 'get_text' 1\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027380887 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376836 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374339 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373683 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379053 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374078 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378891 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381710 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378491 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376836 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379053 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380767 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373683 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380887 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374078 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376836 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378891 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382107 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378491 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382107 2 'NoneType' object has no attribute 'get_text'\n",
      "1111043316665 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027373683 11110273747953  1'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027374016 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382107 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374795 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378894 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043316665 2 'NoneType' object has no attribute 'get_text'\n",
      "11110273774991111027376495 1  1'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027375577 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376666 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376626 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375577 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379727 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377499 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376666 2 'NoneType' object has no attribute 'get_text'\n",
      "1111047229050 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376004 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376626 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377499 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380314 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376666 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378240 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376004 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376666 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376626 11110273774993  2'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027379607 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374981 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376004 3 'NoneType' object has no attribute 'get_text'\n",
      "11110273785651111027379727  2 'NoneType' object has no attribute 'get_text'1\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027374981 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376626 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027378565 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374956 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382642 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027378565 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382642 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379727 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382107 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375198 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376762 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027376762 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378868 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380839 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378096 1 1111027379717'NoneType' object has no attribute 'get_text'\n",
      " 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373862 1 'NoneType' object has no attribute 'get_text'\n",
      "1111041864329 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375198 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381013 1 'NoneType' object has no attribute 'get_text'\n",
      "1111042967521 1 'NoneType' object has no attribute 'get_text'\n",
      "1111046279536 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379859 1 'NoneType' object has no attribute 'get_text'\n",
      "1111046279536 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373897 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381474 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378097 1 'NoneType' object has no attribute 'get_text'\n",
      "1111040863005 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373890 'NoneType' object has no attribute 'find'\n",
      "1111027374786 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379859 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381863 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374330 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380092 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374501 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379861 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378894 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379861 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378894 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027373890 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374724 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375590 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375578 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376353 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374668 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377406 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377435 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379440 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375590 2 'NoneType' object has no attribute 'get_text'\n",
      "11110273747141111027376039  11110273763532 2 1 'NoneType' object has no attribute 'get_text' 'NoneType' object has no attribute 'get_text'\n",
      "'NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027377406 1 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027375578 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377225 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374668 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375827 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376353 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377073 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374668 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377225 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374077 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377411 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376502 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374076 'NoneType' object has no attribute 'find'\n",
      "1111027375569 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377225 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027376353 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375578 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374668 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380916 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375590 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375827 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375578 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377225 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377073 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374076 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375590 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377411 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381841 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376502 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378877 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380897 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381841 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027378877 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375569 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374804 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376353 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374502 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375827 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381479 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381739 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378877 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380768 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374845 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375829 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381479 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381739 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375829 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376828 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380768 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375569 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380897 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374845 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380897 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375569 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380027 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381841 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375569 3 'NoneType' object has no attribute 'get_text'1111027375829\n",
      " 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 2 'NoneType' object has no attribute 'get_text'1111027380027\n",
      " 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374845 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382190 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 2 'NoneType' object has no attribute 'get_text'\n",
      "11110273740731111027374680  1 'NoneType' object has no attribute 'get_text'\n",
      "1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382190 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382035 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382035 21111027382485  'NoneType' object has no attribute 'get_text'\n",
      "11110273774136 'NoneType' object has no attribute 'get_text'\n",
      " 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377413 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027382190 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380027 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027377413 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382035 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 8 'NoneType' object has no attribute 'get_text'\n",
      "11110273746801111027380931  36  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027380027 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 5 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027382485 11110273774139 'NoneType' object has no attribute 'get_text'\n",
      " 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382035 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382190 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027380027 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027382035 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027377413 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382190 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027380567 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027382035 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382190 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 10 'NoneType' object has no attribute 'get_text'11110273809301111027380567\n",
      "  710  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027382190 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377738 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 11 'NoneType' object has no attribute 'get_text'\n",
      "111102738100511110273774131111027382190   96  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "11110273822831 'NoneType' object has no attribute 'get_text' \n",
      "8 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374300 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377738 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 12 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 12 'NoneType' object has no attribute 'get_text'\n",
      "1111027377413 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027377738 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375280 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 13 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380931 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 12 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 14 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 1 'NoneType' object has no attribute 'get_text'\n",
      "11110273809301111027380242  813  'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027375280 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 13 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374300 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374680 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 14 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374300 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 14 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027374707 11110273809301  15'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374300 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374707 2 'NoneType' object has no attribute 'get_text'\n",
      "11110273810051111027382286  115  1111027380930'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      " 16 'NoneType' object has no attribute 'get_text'\n",
      "11110273824851111027380242 11110273773125  4'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      " 1 'NoneType' object has no attribute 'get_text'1111027374680\n",
      " 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375142 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027374300 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 3 'NoneType' object has no attribute 'get_text'\n",
      "11110273773121111027380242 6 'NoneType' object has no attribute 'get_text'\n",
      " 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 16 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381711 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 17 'NoneType' object has no attribute 'get_text'\n",
      "1111027382286 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027374300 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380488 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375998 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 6 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027380930 18 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027382283 101111027380488  'NoneType' object has no attribute 'get_text'2\n",
      " 'NoneType' object has no attribute 'get_text'\n",
      "1111027382286 3 'NoneType' object has no attribute 'get_text'\n",
      "11110273802421111027381711  92 'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380242 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 11110273810059  2 'NoneType' object has no attribute 'get_text''NoneType' object has no attribute 'get_text'\n",
      "\n",
      "1111027374300 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380488 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027382286 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027382286 2 1111027377312'NoneType' object has no attribute 'get_text'\n",
      " 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027375206 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380488 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382286 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 131111027379543 'NoneType' object has no attribute 'get_text' \n",
      "8 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027380488 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027382485 14 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 1 'NoneType' object has no attribute 'get_text'1111027374519\n",
      " 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 11110273813473 'NoneType' object has no attribute 'get_text'\n",
      " 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 19 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 6 'NoneType' object has no attribute 'find_all'\n",
      "1111027375206 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027381005 12 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 5 'NoneType' object has no attribute 'get_text'\n",
      "11110273809301111027381347 1 1111027375206 'NoneType' object has no attribute 'get_text' 20\n",
      "3 'NoneType' object has no attribute 'get_text' \n",
      "'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 21 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027379543 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375206 4 'NoneType' object has no attribute 'get_text'\n",
      "1111027377312 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027381347 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 8 'NoneType' object has no attribute 'get_text'\n",
      "1111027377935 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027375206 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027377351 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 10 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 22 'NoneType' object has no attribute 'get_text'\n",
      "1111027374691 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027375430 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027375206 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 23 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027374519 7 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 24 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 6 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 9 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 11 'NoneType' object has no attribute 'get_text'\n",
      "1111027379194 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 12 'NoneType' object has no attribute 'get_text'\n",
      "1111043257651 1 'NoneType' object has no attribute 'get_text'\n",
      "1111043257651 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 13 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 15 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 3 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 17 'NoneType' object has no attribute 'get_text'\n",
      "1111027381364 5 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 19 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 20 'NoneType' object has no attribute 'get_text'\n",
      "1111027381011 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376652 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373896 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376761 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378000 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380893 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 21 'NoneType' object has no attribute 'get_text'\n",
      "1111027378892 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 22 'NoneType' object has no attribute 'get_text'\n",
      "1111027380323 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376048 1 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1111027377971 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378091 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380930 24 'NoneType' object has no attribute 'get_text'\n",
      "1111027379807 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373689 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373901 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376214 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374086 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376284 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373689 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373901 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375209 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373786 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378448 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379718 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378448 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379571 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027379704 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027381585 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027373759 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027374890 'NoneType' object has no attribute 'find'\n",
      "1111027380029 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380029 1 'NoneType' object has no attribute 'get_text'\n",
      "1111063590117 1 'NoneType' object has no attribute 'get_text'\n",
      "1111063590117 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376196 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376196 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377922 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027378739 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375201 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380111 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027380114 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027377999 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375475 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375201 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375197 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375475 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027377141 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375475 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027380114 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375579 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027375579 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376712 2 'NoneType' object has no attribute 'get_text'\n",
      "1111027376712 1 'NoneType' object has no attribute 'get_text'\n",
      "1111027376712 2 'NoneType' object has no attribute 'get_text'\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-21-c7653c872d73>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      5\u001b[0m     \u001b[0mstart\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mi\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mxiaoqu_list\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mPART\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      6\u001b[0m     \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mi\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mxiaoqu_list\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mPART\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m     \u001b[0mdf_transactions\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdf_transactions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mget_transactions_from_xiaoqu_list\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mCITY\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mxiaoqu_list\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstart\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mend\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      8\u001b[0m     \u001b[0mwriter\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mExcelWriter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"{}_transactions_{}.xlsx\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mCITY\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      9\u001b[0m     \u001b[0mdf_transactions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_excel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mwriter\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"Data\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<ipython-input-20-f8ca33a2cf77>\u001b[0m in \u001b[0;36mget_transactions_from_xiaoqu_list\u001b[0;34m(city, xiaoqu_list)\u001b[0m\n\u001b[1;32m      9\u001b[0m         \u001b[0mfail_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     10\u001b[0m         \u001b[0mcount\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m         \u001b[0;32mfor\u001b[0m \u001b[0mfuture\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfutures\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mas_completed\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfuture_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     12\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mfuture\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     13\u001b[0m                 \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfuture\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/lib/python3.5/concurrent/futures/_base.py\u001b[0m in \u001b[0;36mas_completed\u001b[0;34m(fs, timeout)\u001b[0m\n\u001b[1;32m    213\u001b[0m                             len(pending), len(fs)))\n\u001b[1;32m    214\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 215\u001b[0;31m             \u001b[0mwaiter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mevent\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mwait_timeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    216\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    217\u001b[0m             \u001b[0;32mwith\u001b[0m \u001b[0mwaiter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/lib/python3.5/threading.py\u001b[0m in \u001b[0;36mwait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m    547\u001b[0m             \u001b[0msignaled\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_flag\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    548\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0msignaled\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 549\u001b[0;31m                 \u001b[0msignaled\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cond\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    550\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0msignaled\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    551\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/lib/python3.5/threading.py\u001b[0m in \u001b[0;36mwait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m    291\u001b[0m         \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m    \u001b[0;31m# restore state no matter what (e.g., KeyboardInterrupt)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    292\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mtimeout\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 293\u001b[0;31m                 \u001b[0mwaiter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0macquire\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    294\u001b[0m                 \u001b[0mgotit\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    295\u001b[0m             \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "# 分段爬取，避免失败重新爬，根据具体情况设置PART的值\n",
    "PART = 10\n",
    "df_transactions = pd.DataFrame()\n",
    "for i in range(0, PART):\n",
    "    start = int(i * len(xiaoqu_list) / PART)\n",
    "    end = int((i + 1) * len(xiaoqu_list) / PART)\n",
    "    df_transactions = df_transactions.append(get_transactions_from_xiaoqu_list(CITY, xiaoqu_list[start:end]))\n",
    "    writer = pd.ExcelWriter(\"{}_transactions_{}.xlsx\".format(CITY, i+1))\n",
    "    df_transactions.to_excel(writer, \"Data\")\n",
    "    writer.save()\n",
    "#     df_transactions.to_csv(\"{}_transaction_{}.csv\".format(CITY, i+1), sep=\",\", encoding=\"utf-8\")\n",
    "    print(\"\\nfile {} written.\".format(i+1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 地址编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def encode_address(address):\n",
    "    http_url = \"http://api.map.baidu.com/geocoder/v2/\"\n",
    "    params = {\n",
    "        \"address\": address,\n",
    "        \"ak\": BAIDU_AK,\n",
    "        \"output\": \"json\"\n",
    "    }\n",
    "    try:\n",
    "        ret = requests.get(http_url, params=params)\n",
    "        o = json.loads(ret.text)\n",
    "        if o['status'] != 0:\n",
    "            print(\"[E]: 地址编码异常: {}，\".format(o['status']) + address)\n",
    "            return None\n",
    "        longtitude = o['result']['location']['lng']\n",
    "        latitude = o['result']['location']['lat']\n",
    "        return longtitude, latitude\n",
    "    except Exception as e:\n",
    "        print(\"[E]: 地址编码错误，\" + address + e)\n",
    "        return None"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 测试区域\n",
    "测试部分函数的运行结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "http_url = \"https://bj.lianjia.com/xiaoqu/\"\n",
    "HEADERS[\"User-Agent\"] = ua.random\n",
    "r = requests.get(http_url, headers=HEADERS, proxies=proxies)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_xiaoqu_info = pd.read_csv(\"./{}_info.csv\".format(CITY), index_col=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(104.11217928913484, 30.676402004954433)"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "encode_address(\"成都(成华建设路)建设南支巷1号（万科钻石广场旁）\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "http_url = \"http://api.map.baidu.com/geocoder/v2/\"\n",
    "params = {\n",
    "    \"address\": \"广州天河华景新城中山大道109号\",\n",
    "    \"ak\": BAIDU_AK,\n",
    "    \"output\": \"json\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "ret = requests.get(http_url, params=params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"status\":0,\"result\":{\"location\":{\"lng\":113.36649400041135,\"lat\":23.142691011341574},\"precise\":1,\"confidence\":80,\"level\":\"道路\"}}'"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ret.text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
